package com.vert.utils;

import com.alibaba.fastjson.JSONObject;

/**
 * @Classname Results
 * @Description TODO
 * @Date 2022/5/26 15:31
 * @Created by XiongXiong
 * @Author: X.I.O
 */
public class Results {

    private static JSONObject getJSONObject(){
        JSONObject obj= null;
        obj=new JSONObject();
        obj.put("code",0);
        obj.put("msg","success");
        return obj;
    }

    public static JSONObject success(){
        return getJSONObject();
    }

    public static JSONObject success(String msg){
        JSONObject obj=getJSONObject();
        obj.put("msg",msg);
        return obj;
    }

    public static JSONObject success(String msg,Object obj){
        JSONObject data = getJSONObject();
        data.put("msg",msg);
        data.put("data",obj);
        return data;
    }

    public static JSONObject success(Object obj){
      JSONObject data = getJSONObject();
      data.put("data",obj);
      return data;
    }
}
